$name_cel = "GSE7307";
$dir = "/data1/bsi/BORA_processing/devel/data_HGUPLUS2/$name_cel";
open(BUFF,"ls $dir |");
$name = 0;
system("mkdir /data1/bsi/BORA_processing/devel/data_HGUPLUS2/results_$name_cel");
while($line = <BUFF> )
{
	
	chomp($line);
	system("cp $dir/$line /data1/bsi/BORA_processing/devel/data_HGUPLUS2/temp/");
	for($i=1;$i<99;$i++)
	{
		$line = <BUFF>;
		chomp($line);
		system("cp $dir/$line /data1/bsi/BORA_processing/devel/data_HGUPLUS2/temp/");
	}
	$name ++;
	$frma = "$name"."_frma.txt";
	$barcode =  "$name"."_barcode.txt";
	$present_absent = "$name"."present_absent.txt";
	system("/usr/local/biotools/r/R-2.12.2/bin/Rscript /data1/bsi/BORA_processing/devel/data_HGUPLUS2/rscript_barcode_presentabsent.R");
	system("mv /data1/bsi/BORA_processing/devel/data_HGUPLUS2/tempresults/frma.txt /data1/bsi/BORA_processing/devel/data_HGUPLUS2/results_$name_cel/$frma ");
	system("mv /data1/bsi/BORA_processing/devel/data_HGUPLUS2/tempresults/barcode.txt /data1/bsi/BORA_processing/devel/data_HGUPLUS2/results_$name_cel/$barcode");
	system("mv /data1/bsi/BORA_processing/devel/data_HGUPLUS2/tempresults/present_absent.txt /data1/bsi/BORA_processing/devel/data_HGUPLUS2/results_$name_cel/$present_absent");
	system("rm /data1/bsi/BORA_processing/devel/data_HGUPLUS2/temp/*");
	#die;
}
